bitkeeper revision 1.1369 (426927a5No_sHhV62q0TEbxYu-jcHA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 22 Apr 2005 16:34:45 +0000 (16:34 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 22 Apr 2005 16:34:45 +0000 (16:34 +0000)
Hypercall preemption check also looks for pending event upcalls to
guest kernel.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/include/xen/sched.h

index c5f799992d70c0b26de7aef30292dda065c9b039..915abaeddfe98af049f01c526d260808399cfbe3 100644 (file)
@@ -301,8 +301,11 @@ unsigned long __hypercall_create_continuation(
         (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
         (unsigned long)(_a4), (unsigned long)(_a5), (unsigned long)(_a6))
 
-#define hypercall_preempt_check() \
-    (unlikely(softirq_pending(smp_processor_id())))
+#define hypercall_preempt_check() (unlikely(            \
+        softirq_pending(smp_processor_id()) |           \
+        (!!current->vcpu_info->evtchn_upcall_pending &  \
+          !current->vcpu_info->evtchn_upcall_mask)      \
+    ))
 
 /* This domain_hash and domain_list are protected by the domlist_lock. */
 #define DOMAIN_HASH_SIZE 256
@@ -310,11 +313,13 @@ unsigned long __hypercall_create_continuation(
 extern struct domain *domain_hash[DOMAIN_HASH_SIZE];
 extern struct domain *domain_list;
 
-#define for_each_domain(_p) \
- for ( (_p) = domain_list; (_p) != NULL; (_p) = (_p)->next_list )
+#define for_each_domain(_d) \
+ for ( (_d) = domain_list; (_d) != NULL; (_d) = (_d)->next_list )
 
 #define for_each_exec_domain(_d,_ed) \
- for ( (_ed) = _d->exec_domain[0]; (_ed) != NULL; (_ed) = (_ed)->ed_next_list )
+ for ( (_ed) = (_d)->exec_domain[0]; \
+       (_ed) != NULL;                \
+       (_ed) = (_ed)->ed_next_list )
 
 #define EDF_DONEFPUINIT  0 /* Has the FPU been initialised for this task?    */
 #define EDF_USEDFPU      1 /* Has this task used the FPU since last save?    */